<script setup>
import { inject } from 'vue';
const title = inject('title')

const props = defineProps({
  name: String
})

const emit = defineEmits(['change'])


function setName () {
  console.log('1234567890');
  // this.$emit()

  console.log(emit);
  emit('change', '您好')
}

</script>
<template>
  <h1>
    你好世界 -- {{ title }} -- {{ props.name }}
    <button @click="setName">给父组件传值</button>
  </h1>
</template>
